<?php /* Smarty version 2.6.18, created on 2016-12-12 13:02:14
         compiled from inform/m.superior.list.tpl.php */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "m.index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<!--头部 end--> 
<!--主体部分-->
 <form name="myform" action="" method="get">
<div class="container" style="margin-top:70px;">
  <div class="row" style="margin-top:10px;margin-bottom:20px;">
    <div class="col-sm-12 distance" >
      <div class="form-group">
        <div class="col-sm-10  text-center">
          <div class="col-xs-6"><a type="button" class="btn btn-primary " href="index.php?a=inform.superiorlist&inform_type=<?php echo $this->_tpl_vars['inform_type']; ?>
">上级通知</a> </div>
          <div class="col-xs-6"><a type="button" class="btn btn-default" href="index.php?a=inform.dispenselist&inform_type=<?php echo $this->_tpl_vars['inform_type']; ?>
">分发列表</a></div>
        </div>
      </div>
    </div>
  </div>
  <div class="row" style="margin-right:10%;">
    <div  class="col-xs-sm  text-right" > <a class="btn btn-primary" href="index.php?a=inform.superioradd&inform_type=<?php echo $this->_tpl_vars['inform_type']; ?>
" style="width:30%">增加</a></div>
  </div>
  <div class="row" style="margin-top:10px;">
    <form method="post" action="">
      <div class="col-sm-12 distance hierarchy2">
        <div class="form-group">
          <label for="" class="col-sm-2 control-label">标题:</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" name="inform_title" value="<?php echo $this->_tpl_vars['inform_title']; ?>
">
          </div>
        </div>
      </div>
      <div class="col-sm-12 distance hierarchy" >
        <div class="form-group hierarchy" >
          <label for="" class="col-sm-2 control-label">上级部门:</label>
          <div class="col-sm-10">
            <select class="form-control" name="up_id">
			<option value="">全部</option>
			<?php $_from = $this->_tpl_vars['up_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				<option value="<?php echo $this->_tpl_vars['value']['up_id']; ?>
"<?php if ($this->_tpl_vars['value']['up_id'] == $this->_tpl_vars['up_id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['value']['up_name']; ?>
</option>
			<?php endforeach; endif; unset($_from); ?>
			</select> 
          </div>
        </div>
      </div>
      <div class="col-sm-12 distance hierarchy">
        <div class="form-group">
          <label for="" class="col-sm-2 control-label">开始时间:</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" value="<?php echo $this->_tpl_vars['from']; ?>
" id="from" name="from">
          </div>
        </div>
      </div>
      <div class="col-sm-12 distance hierarchy">
        <div class="form-group">
          <label for="" class="col-sm-2 control-label">结束时间:</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" value="<?php echo $this->_tpl_vars['to']; ?>
" id="to" name="to">
          </div>
        </div>
      </div>
      <div class="col-xs-12 distance" >
          <div class="form-group  text-center" style="padding-top:0px;">
             <div class="col-xs-12">
              <input type="hidden" name="a" value="inform.superiorlist">
              <input type="hidden" name="inform_type" value="<?php echo $this->_tpl_vars['inform_type']; ?>
">
              <button type="submit" class="btn btn-success absolutely ">搜索</button>
              </div>
          </div>
      </div>
    </form>
  </div>
  <div class="row" style="margin-top:15px;margin-left:1px; margin-right:1px;">
  <?php $_from = $this->_tpl_vars['inform_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
    <table class="table table-striped table-bordered "  id="middles">
      <tr>
        <td>标题</td>
        <td><?php echo $this->_tpl_vars['value']['inform_title']; ?>
</td>
      </tr>
      <tr>
        <td>文档号</td>
        <td><?php echo $this->_tpl_vars['value']['inform_num']; ?>
</td>
      </tr>
      <tr>
        <td>上级部门</td>
        <td><?php echo $this->_tpl_vars['value']['up_name']; ?>
</td>
      </tr>
      <tr>
        <td>下达时间</td>
        <td><?php echo $this->_tpl_vars['value']['start_time']; ?>
</td>
      </tr>
      <tr>
        <td>要求完成时间</td>
        <td><?php echo $this->_tpl_vars['value']['end_time']; ?>
</td>
      </tr>
      <tr>
        <td>备注</td>
        <td><?php echo $this->_tpl_vars['value']['inform_content']; ?>
</td>
      </tr>
      <tr>
        <td>附件</td>
        <td><?php echo $this->_tpl_vars['value']['inform_file']; ?>
</td>
      </tr>
      <tr>
        <td>操作</td>
        <td ><a type="button" class="btn btn-warning  " href="index.php?a=inform.superiordetails&inform_type=<?php echo $this->_tpl_vars['inform_type']; ?>
&inform_id=<?php echo $this->_tpl_vars['value']['inform_id']; ?>
" >查看</a> 
             <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal" onClick="show('<?php echo $this->_tpl_vars['value']['inform_id']; ?>
')">转发</button></td>
      </tr>
     </table>
	 <?php endforeach; endif; unset($_from); ?>   
      <!-- Modal -->
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
	<div class="modal-content" style="margin-top:120px;">
	  <form name="form2" action="" method="post">
		  <div class="modal-header">
			<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
			<h4 class="modal-title" id="myModalLabel">选择分发对象 ：</h4>
		  </div>
		  <div class="modal-body">
			  <div class="form-group">
					  <div class="col-sm-1" style="padding:0;">
						   <label id="jiao" style="font-weight:100;">选择教师</label>
					  </div>
					  <div class="col-sm-11 col-xs-10">
								 
								<div class="col-sm-12">
											<ul id="tree2" class="ztree"></ul>
								</div>
					  </div>
				</div>
				<div style="clear:both; height:10px;"></div>
				<div class="form-group">
					 <div class="col-sm-1" style="padding:0;">
						   <label id="jiao" style="font-weight:100;">选择学生</label>
					  </div>
					  <div class="col-sm-10 col-xs-10">
							  <div class="col-sm-12">
								   <ul id="treeDemo" class="ztree"></ul>
								   <div style="display:none;">
										被勾选时：<input type="checkbox" id="py" class="checkbox first" checked /><span>关联父</span>
										<input type="checkbox" id="sy" class="checkbox first" checked /><span>关联子</span><br/>
										取消勾选时：<input type="checkbox" id="pn" class="checkbox first" checked /><span>关联父</span>
										<input type="checkbox" id="sn" class="checkbox first" checked /><span>关联子</span><br/>
									</div>
							  </div>
					  </div> 
				</div>  
		  </div>
		  <div style="clear:both;"></div>
						<div id="hiddenBox"></div>
		  <div class="modal-footer" >
			<input type="hidden" name="inform_id" value="" id="aaa">
			<button type="submit" class="btn btn-primary"  onclick="c();" >确定</button>
		  </div>
	  </form>
	</div>
  </div>
</div>
<!--container  end--> 

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "m.index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script src="mstatic/js/jquery-ui.js"  type="text/javascript"></script><!--日历--> 
<script>
function show(a){
	
	$("#aaa").val(a);
	
	}
</script>
<script>
  $(function() {
    $( "#from" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
	  changeYear: true,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#to" ).datepicker( "option", "minDate", selectedDate );
      }
    });
    $( "#to" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
      changeYear: true,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#from" ).datepicker( "option", "maxDate", selectedDate );
      }
    });
  });
  </script>

<script src="static/js/jquery.ztree.core.js"></script><!--树形-->
<script src="static/js/jquery.ztree.excheck.js"></script><!--树形-->
 
<script>
     var setting = {
            check: {
                enable: true
            },
            view:{
                showIcon:false
            },
              
            data: {
                simpleData: {
                    enable: true
                }
            }
        };
        var ztNodes =[
		    { id:"g0", pId:0, name:"全体教师"},
			{ id:"g1", pId:"g0", name:"部门"},
			<?php $_from = $this->_tpl_vars['department_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"bm_<?php echo $this->_tpl_vars['value']['department_id']; ?>
", pId:"g1", name:"<?php echo $this->_tpl_vars['value']['department_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>			
			<?php $_from = $this->_tpl_vars['department_name']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"bm_<?php echo $this->_tpl_vars['value']['department_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['staff_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			{ id:"g2", pId:"g0", name:"教研组"},
			<?php $_from = $this->_tpl_vars['research_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"xka_<?php echo $this->_tpl_vars['value']['research_id']; ?>
", pId:"g2", name:"<?php echo $this->_tpl_vars['value']['research_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			<?php $_from = $this->_tpl_vars['research_name']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"xka_<?php echo $this->_tpl_vars['value']['research_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['staff_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			{ id:"g3", pId:"g0", name:"备课组"},
			<?php $_from = $this->_tpl_vars['prepare_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"xkb_<?php echo $this->_tpl_vars['value']['prepare_id']; ?>
", pId:"g3", name:"<?php echo $this->_tpl_vars['value']['prepare_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			<?php $_from = $this->_tpl_vars['prepare_name']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"xkb_<?php echo $this->_tpl_vars['value']['prepare_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['staff_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			{ id:"g4", pId:"g0", name:"学科组"},
			<?php $_from = $this->_tpl_vars['discipline_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"xkc_<?php echo $this->_tpl_vars['value']['discipline_id']; ?>
", pId:"g4", name:"<?php echo $this->_tpl_vars['value']['discipline_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			<?php $_from = $this->_tpl_vars['discipline_name']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"xkc_<?php echo $this->_tpl_vars['value']['discipline_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['staff_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			
];
        var ztcode;
        function setCheck1() {
            var zTree = $.fn.zTree.getZTreeObj("tree2"),
            py = $("#py").attr("checked")? "p":"",
            sy = $("#sy").attr("checked")? "s":"",
            pn = $("#pn").attr("checked")? "p":"",
            sn = $("#sn").attr("checked")? "s":"",
            type = { "Y":py + sy, "N":pn + sn};
            zTree.setting.check.chkboxType = type;
            showCode('setting.check.chkboxType = { "Y" : "' + type.Y + '", "N" : "' + type.N + '" };');
        }
        function showCode1(str) {
            if (!ztcode) ztcode = $("#ztcode");
            ztcode.empty();
            ztcode.append("<li>"+str+"</li>");
        }
        $(document).ready(function(){
            $.fn.zTree.init($("#tree2"), setting, ztNodes);
            setCheck1();
            $("#py").bind("change", setCheck1);
            $("#sy").bind("change", setCheck1);
            $("#pn").bind("change", setCheck1);
            $("#sn").bind("change", setCheck1);
        });
</script>

<script type="text/javascript">
		var setting = {
			check: {
				enable: true,	
			},
			data: {
				simpleData: {
					enable: true
				}
			}
		};
		var zNodes =[
		{ id:"b0", pId:0, name:"全体学生", },
		<?php $_from = $this->_tpl_vars['grade_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
			{ id:"g_<?php echo $this->_tpl_vars['key']; ?>
", pId:"b0", name:"<?php echo $this->_tpl_vars['value']; ?>
", open:true},
		<?php endforeach; endif; unset($_from); ?>
		<?php $_from = $this->_tpl_vars['class_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
			{ id:"c_<?php echo $this->_tpl_vars['value']['class_id']; ?>
", pId:"g_<?php echo $this->_tpl_vars['value']['grade_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['class_name']; ?>
", open:true},
		<?php endforeach; endif; unset($_from); ?>
		<?php $_from = $this->_tpl_vars['student_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
			{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"c_<?php echo $this->_tpl_vars['value']['class_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['student_name']; ?>
", <?php if ($this->_tpl_vars['value']['is_check'] == '1'): ?>checked:true,<?php endif; ?> open:true, last:true},
		<?php endforeach; endif; unset($_from); ?>
		];
		var code;
		
		function setCheck() {
			var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
			py = $("#py").attr("checked")? "p":"",
			sy = $("#sy").attr("checked")? "s":"",
			pn = $("#pn").attr("checked")? "p":"",
			sn = $("#sn").attr("checked")? "s":"",
			type = { "Y":py + sy, "N":pn + sn};
			zTree.setting.check.chkboxType = type;
			showCode('setting.check.chkboxType = { "Y" : "' + type.Y + '", "N" : "' + type.N + '" };');
		}
		function showCode(str) {
			if (!code) code = $("#code");
			code.empty();
			code.append("<li>"+str+"</li>");
		}
		$(document).ready(function(){
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
			setCheck();
			$("#py").bind("change", setCheck);
			$("#sy").bind("change", setCheck);
			$("#pn").bind("change", setCheck);
			$("#sn").bind("change", setCheck);
		});
function c()
{
	var delidID = "";
	var zTree = $.fn.zTree.getZTreeObj("treeDemo").getCheckedNodes(true);//获取所有选中状态的节点  
	for (var i = 0; i < zTree.length; i++) {  
		//delidID += zTree[i].id + ",";
		$("#hiddenBox").append('<input type="hidden" name="pid[]" value="'+zTree[i].id+'">');
	}
	var zTree = $.fn.zTree.getZTreeObj("tree2").getCheckedNodes(true);//获取所有选中状态的节点  
	for (var i = 0; i < zTree.length; i++) {  
		//delidID += zTree[i].id + ",";
		$("#hiddenBox").append('<input type="hidden" name="pid[]" value="'+zTree[i].id+'">');
	}
} 		
</script>